#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

/*
float add(float a, float b)
{
	return a + b;
}

float sub(float a, float b)
{
	return a - b;
}

float div(float a, float b)
{
	if (b==0)
	{
		printf("The zero can't divide other number\n");
	}
	else
	{
		return a / b;
	}
}

float multiply(float a, float b)
{
	return a * b;
}

void menu1()
{
	printf("1 . Add\n");
	printf("2 . Sub\n");
	printf("3 . Divide\n");
	printf("4 . Multiply\n");
	printf("Make your choice\n");
}

int main()
{
	int choice = 0;
	do
	{
		float(*pf)(float, float) = NULL;
		float a = 0, b = 0;
		printf("--- The Calculator ---\n");

		scanf("%f %f",&a,&b);
		while (getchar() != '\n')
			continue;

		menu1();
		printf("Please make your choice:");
		again:
		scanf("%d",&choice);
		while (getchar() != '\n')
			continue;

		switch (choice)
		{
		case 1:
			pf = add;
			break;
		case 2:
			pf = sub;
			break;
		case 3:
			pf = div;
			break;
		case 4:
			pf = multiply;
			break;
		case 0:
			break;
		default:
			printf("Please input the right choice:");
			goto again;
		}
		if (pf)
			printf("%.2f\n", pf(a, b));
	} while (choice);
	printf("Good bye!");
	return 0;

}

*/